<?php
use common\Yii01;
use yii\widgets\ActiveForm;
use frontend\models\Anonymous;
use yii\helpers\Html;

$model = new Anonymous();
$anonymous_name = Yii::$app->request->cookies->get("anonymous_name");
$name ="无名";
if ($anonymous_name) {
    $model->name = $anonymous_name;
    $name = $anonymous_name;
}
$anonymous_signature = Yii::$app->request->cookies->get("anonymous_signature");
if ($anonymous_signature) {
    $model->signature = $anonymous_signature;
}

?>



<div id="floatbox">


<?php if (Yii::$app->user->id) : ?>
    <div class="sidebar pd20 mb20 sideb"  >
  
        <ul class="list-unstyled mt20">
            <li><span class="glyphicon glyphicon-gift"></span> 收藏 <a href="<?=Yii::$app->urlManager->createUrl("member/collect")?>"><?=Yii01::getCollectPostNum(Yii::$app->user->id)?></a></li>
            <li><span class="glyphicon glyphicon-bell"></span> 帖子：<a href="<?=Yii::$app->urlManager->createUrl("member/topic")?>"><?=Yii01::getUserPostNumByType(Yii::$app->user->id,2)?></a></li>
            <li><span class="glyphicon glyphicon-list-alt"></span> 图片：<a href="<?=Yii::$app->urlManager->createUrl("member/article")?>"><?=Yii01::getUserPostNumByType(Yii::$app->user->id,1)?></a></li>
            <li><span class="glyphicon glyphicon-link"></span> 链接：<a href="<?=Yii::$app->urlManager->createUrl("member/url")?>"><?=Yii01::getUserPostNumByType(Yii::$app->user->id,3)?></a></li>
            <li><span class="glyphicon glyphicon-comment"></span> 评论：<?=Yii01::getUserComments(Yii::$app->user->id)?></li>
            <li>
                <span class="glyphicon glyphicon-calendar"></span> 总签到：<?=Yii01::getUserInfo('total_signin')?>次
                <ul>
                    <li>最大连续签到：<?=Yii01::getUserInfo('max_signin')?>天</li>
                    <li>目前连续签到：<?=Yii01::getUserInfo('current_signin')?>天</li>
                </ul>
            </li>
            <li><span class="glyphicon glyphicon-dashboard"></span> 总在线时间：<?=sprintf("%.2f",Yii01::getUserInfo('online_time')/60)?>小时</li>
            <li><span class="glyphicon glyphicon-time"></span> 注册时间：<?=date("Y-m-d H:i:s",Yii01::getUserInfo('created_at'))?></li>
            <li><span class="glyphicon glyphicon-hourglass"></span> 上次登录：<?=date("Y-m-d H:i:s",Yii01::getUserInfo('updated_at'))?></li>
        </ul>
        <?php if(Yii01::getUserInfo('signin_time') != date("Ymd")):?>
        <button class="btn btn-info btn-block signin" type="button">
            <span>马 上 签 到</span>
        </button>
        <?php else: ?>
            <button class="btn btn-danger btn-block" type="button">
                <span>今 日 已 签 到</span>
            </button>
        <?php endif?>


    </div>
<?php endif; ?>
</div>
<?php
$num = Yii01::getReplayNum();
$css = <<<SB
.msgnum:after{
  content: "{$num}";
  color: #fff;
  position: absolute;
  bottom: 12px;
  padding: 3px;
  z-index: 9999999;
  background: #d9534f;
  border-radius: 50%;
  font-size: 12px;
}
SB;
$this->registerCss($css);

?>